﻿@{
    var userName = Request.QueryString["UserName"];
    var externalLoginData = Request.QueryString["ExternalLoginData"];
}

<h1>@Html.TitleForPage(T("Create a New Account").ToString())</h1>

@if (!string.IsNullOrWhiteSpace(userName) && !string.IsNullOrWhiteSpace(externalLoginData)) {
    <fieldset class="group">
        <legend>@T("External Service Association")</legend>
        <p>@T("This user account will be linked to <b>{0}</b> when you login.", userName)</p>
    </fieldset>
}


<fieldset class="group">
    <legend>@T("Account Information")</legend>
    <p>@T("Use the form below to create a new account.")</p>
    <p>@T("Passwords are required to be a minimum of {0} characters in length.", ViewData["PasswordLength"])</p>
    @Html.ValidationSummary(T("Account creation was unsuccessful. Please correct the errors and try again.").ToString()) 

    @using (Html.BeginFormAntiForgeryPost()) { 
    <div>
        <label for="username">@T("Username:")</label>
        @Html.TextBox("username") 
        @Html.ValidationMessage("username") 
    </div>
    <div>
        <label for="email">@T("Email:")</label>
        @Html.TextBox("email") 
        @Html.ValidationMessage("email") 
    </div>
    <div>
        <label for="password">@T("Password:")</label>
        @Html.Password("password") 
        @Html.ValidationMessage("password") 
    </div>
    <div>
        <label for="confirmPassword">@T("Confirm password:")</label>
        @Html.Password("confirmPassword") 
        @Html.ValidationMessage("confirmPassword") 
    </div>
    <div>
        <button class="primaryAction" type="submit">@T("Register")</button>
    </div>
    } 
</fieldset>
 